home *** CD-ROM | disk | FTP | other *** search
- /* --------------------------------------------------- */
- /* Final Copy II Arexx Macro - OBJECT COPY */
- /* This macro will make a copy of the current selected */
- /* object (except ILBMs). */
- /* --------------------------------------------------- */
- Options Results
-
- /* ------------------------------------ */
- /* Set parameters to be in ruler units. */
- /* ------------------------------------ */
- SetMeasure Ruler
-
- /* ----------------------------------------- */
- /* These are the offsets for the new object */
- /* in inches. (.5 = 1/2 inch). */
- /* ----------------------------------------- */
- XOffset = .5
- YOffset = .5
-
- /* ------------------------------------ */
- /* Get the Id of the current object. */
- /* If there is no current object then */
- /* exit the macro. */
- /* ------------------------------------ */
- CurrentObject
- objectId = Result
- IF (objectId = 0) THEN
- EXIT
-
- /* ------------------------------------ */
- /* Find out the type of the object. */
- /* We don't want to copy an ILBM. */
- /* ------------------------------------ */
- GetObjectType objectId
- type = Result
- IF (type ~= 1) THEN
- DO
-
- /* ------------------------------------ */
- /* Get the coordinates and parameters */
- /* for the selected object. */
- /* ------------------------------------ */
- GetObjectCoords objectId
- coords = Result
- GetObjectParams objectId
- params = Result
-
- page = Word(coords, 1)
- IF (type = 2 | type = 3) THEN
- DO
- x1 = Word(coords, 2) + XOffset
- y1 = Word(coords, 3) + YOffset
- x2 = Word(coords, 4) + XOffset
- y2 = Word(coords, 5) + YOffset
- END
- ELSE
- DO
- left = Word(coords, 2) + XOffset
- top = Word(coords, 3) + YOffset
- width = Word(coords, 4)
- height = Word(coords, 5)
- END
-
- modifier = ""
- IF (type = 3) THEN
- modifier = "ARROW"
- ELSE IF (type = 5) THEN
- modifier = "BEVEL"
-
- IF (type = 2 | type = 3) THEN
- DrawLine page x1 y1 x2 y2 modifier
- ELSE IF (type = 4 | type = 5) THEN
- DrawBox page left top width height modifier
- ELSE
- DrawOval page left top width height
-
- newObjectId = Result
-
- /* ------------------------------- */
- /* Now Set the object parameters. */
- /* ------------------------------- */
- SetObjectParams newObjectId params
-
- /* ------------------------------- */
- /* Draw the new object. */
- /* ------------------------------- */
- Redraw
- END
-